1. Field of the Invention
The present invention relates to an image processing apparatus and image processing method for correcting sharpness.
2. Description of the Related Art
Recently, a refocus processing technique capable of changing the shooting distance and the depth of field after shooting has received attention. US2007/0252074A1 describes a technique capable of changing the shooting distance and the depth of field after shooting by using light field photography (to be referred to as LFP). Refocus processing has a feature of obtaining an image at an arbitrary shooting distance and an arbitrary depth of field by setting a virtual shooting distance and compositing multi-viewpoint images in consideration of the distance.
In LFP, a microlens array is arranged in front of an image sensor and multi-viewpoint images can be obtained by one shooting, which cannot be obtained by a general camera. US2007/0230944A1 describes a technique of implementing refocus processing by obtaining multi-viewpoint images by a multi-eye camera.
The object distance of each pixel can be attained by applying these refocus processing. Using LFP, it is conceivable to generate a distance map by holding, for each pixel, a distance at which the local contrast maximizes, while moving the virtual shooting distance from the shortest one to infinity.
Japanese Patent Laid-Open No. 8-163423 discloses a technique of generating a distance map. More specifically, many images are captured while actually changing the shooting distance from the shortest one to infinity. Images in which the local contrast maximizes are selected and mapped for respective pixels.
Japanese Patent Laid-Open No. 2000-156816 discloses a technique of performing sharpness processing corresponding to the object distance in shooting by using a distance map obtained in this way. Japanese Patent Laid-Open No. 2006-67521 discloses a technique of dividing an image into regions such as a short distance, middle distance, and far distance and applying different filters in accordance with the distances. A 3D image can be obtained from 2D images by applying different filter processes in accordance with distances relative to an object distance (shooting distance) arbitrarily set for an image.
As described above, the conventional sharpness processing is applied in accordance with a distance relative to an arbitrarily designated object distance (shooting distance).
When the object is positioned in front of a far background, it is not preferable to equally handle the texture of the object surface and the boundary between the object and the background, that is, apply the same sharpness processing to the texture of the object surface and the boundary between the object and the background. When the degree of sharpening is changed depending on a distance relative to a distance (shooting distance) set in advance for an image and an image to be finally obtained is a deep-focus image, the image undergoes almost the same processing as simple sharpness processing, failing to obtain a 3D output.
When obtaining a distance map according to the method described in Japanese Patent Laid-Open No. 8-163423, many images of the same resolution as the final output image are used, requiring a very large capacity of the work memory or recording medium.
Refocus processing can provide a distance map by using only a work memory or recording medium necessary to take one shot. However, images at a plurality of viewpoints are recorded on one image, so the resolution of an output image decreases depending on the number of viewpoints.